<table class="layui-table text-center" lay-size="sm">
    <thead>
        <tr>
            <th><input type="checkbox" class="checked-all" target="stock-id"></th>
            <th>图片</th>
            <th>仓库</th>
            <th>SKU</th>
            <th>库位</th>
            <th>现有库存</th>
            <th>占用库存</th>
            <th>在途库存</th>
            <th>预警库存</th>
            <th>上限库存</th>
            <th>状态</th>
            <th>单价</th>
            <th>总货值</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {volist name="list" id="item"}
            <tr>
                <td><input type="checkbox" class="stock-id" name="stock_id[]" value="{$item.stock_id}"></td>
                <td width="100"><img src="{$item.image_url}" width="100px"></td>
                <td>{$item.warehouse.name}</td>
                <td class="copy-text">{$item.sku}</td>
                <td class="copy-text">{$item.location ? $item.location.code : ''}</td>
                <td>{$item.stock}</td>
                <td>{$item.lock_stock}</td>
                <td>{$item.purchase_stock}</td>
                <td>{$item.min_stock?:''}</td>
                <td>{$item.max_stock?:''}</td>
                <td>
                    {php}$status = $item['status'];{/php}
                    <a href="{:url('save',['stock_id'=>$item['stock_id'], 'status'=>abs(1-$status)])}" class="ajax-get" msg="0" style="font-size: 16px;">
                        {$status?'<i class="fa fa-unlock"></i>':'<i class="fa fa-lock text-red"></i>'}</a>
                </td>
                <td>{$item.price|abs}</td>
                <td>{$item.total_money|abs}</td>
                <td class="text-left">{$item.remark}</td>
                <td>
                    {if $is_show_edit}
                    <a href="{:url('add',['stock_id'=>$item['stock_id']])}" width-form="50%" height-form="50%" class="layui-btn layui-btn-xs layui-btn-normal ajax-form" title="库存">编辑</a>
                    {/if}
                </td>
            </tr>
        {/volist}
        {empty name="list"}
        <tr>
            <td colspan="15">没有数据</td>
        </tr>
        {/empty}
    </tbody>
</table>
<div class="page">
    {$page|raw}
</div>